
// list.js
var that;
let App = getApp();
Page({
	data: {
		page_index: 0,
		orderList: [],
		loadingTip: '',
		isAdmin: wx.getStorageSync('isAdmin'),
		visual: 'hidden',
		total_num:''
	},
  orderList(){
    that = this;
    wx.request({
      url: App.url.requestUrl + 'order/orderList',
      method: 'POST',
      header: { 'content-type': 'application/x-www-form-urlencoded', "token": wx.getStorageSync('access_token') },
      dataType: 'json',
      data: {
        page: 1
      },
      success: function (res) {
        console.log(res)
        if (res.data.ret == 200) {
          if (res.data.data.length > 0) {

            that.setData({
              orderList: res.data.data,

            })
          } else {
            that.setData({
              visual: 'show'
            })
          }

        }
      }
    })
  },
	onLoad: function () {
    that = this;
    that.orderList()
		
	},
  onShow: function () {
    this.orderList()
  },
	showDetail(e){
		
		var id = e.currentTarget.dataset.id;
		wx.navigateTo({
			url: '../detail/detail?id=' + id
		})
	}
	

})